﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Text;

namespace WeFeTeLib
{
    /// <summary>
    /// This class define the responses that a default file can send in a determinated MVC.
    /// </summary>
    public class File
    {
        string name;
        string content;
        long lenght;
        HttpStatusCode code;

        /// <summary>
        /// Generate a new File object
        /// </summary>
        /// <param name="Name">The name of the file (without the starting /)</param>
        /// <param name="Content">A piece of the text that we can found in the content of the file</param>
        /// <param name="HTTPCode">The HTTP Status Code that the server send us when requesting the file</param>
        public File(string Name, string Content, HttpStatusCode HTTPCode)
        {
            name = Name;
            content = Content;
            code = HTTPCode;
        }

        /// <summary>
        /// Generate a new File object (this is prefered to image files)
        /// </summary>
        /// <param name="Name">The name of the file (without the starting /)</param>
        /// <param name="FileLength">The length of the content of the file</param>
        /// <param name="HTTPCode">The HTTP Status Code that the server send us when requesting the file</param>
        public File(string Name, long FileLength, HttpStatusCode HTTPCode)
        {
            name = Name;
            lenght = FileLength;
            code = HTTPCode;
        }

        /// <summary>
        /// The name of the file
        /// </summary>
        public string Name
        {
            get { return name; }
        }

        /// <summary>
        /// The content of the file
        /// </summary>
        public string Content
        {
            get { return content; }
        }

        /// <summary>
        /// The HTTP Status Code that is served by the web server when we access to the file
        /// </summary>
        public HttpStatusCode HTTPCode
        {
            get { return code; }
        }

        /// <summary>
        /// The length of the file (in bytes)
        /// </summary>
        public long FileLength
        {
            get { return lenght; }
        }
    }
}
